<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$Title$</title>
    <link href="${request.contextPath}/static/ihomeStatic/css/bootstrap.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/animate.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/style.min.css?v=3.2.0" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/js/layer/mobile/need/layer.css">
</head>
<body class="gray-bg">
<input type="hidden" id="idss" value="${id}">
<input type="hidden" id="h1">
<div class="wrapper">
    <div class="row">
        <div class="ibox">
            <div class="ibox-content">
                <div class="container-fluid breadcrumb">
                    <div class="row-fluid span12">
                        <span class="span4">角色名称: <b>${role.roleName}</b></span>
                        <span class="span4">角色值: ${role.roleKey}</span>
                    </div>
                </div>

                <button id="assignButton" class="btn  btn-primary btn-sm" title="添加人员" onclick="add()"><i
                            class="fa fa-plus"></i> 添加人员
                </button>
                <table id="contentTable"
                       class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
                    <thead>
                    <tr>
                        <th>归属部门</th>
                        <th>登录名</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>手机</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#list userList as user >

                        <tr>
                            <td>${user.deptName}</td>
                            <td>${user.loginName}</td>
                            <td>${user.userName}</td>
                            <td>${user.email}</td>
                            <td>${user.phonenumber}</td>
                            <td><a href="javascript:;" onclick="deleteById('${user.userId}')">移除</a>
                            </td>
                        </tr>
                    </#list>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</body>

<script src="${request.contextPath}/static/ihomeStatic/js/jquery-1.12.4.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/bootstrap-table.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/layer/layer.js"></script>
<script>
        function deleteById(uid) {
            layer.confirm('是否确定删除？', {
                btn: ['是','否'] //按钮
            }, function(){
                $.ajax({
                    url:"${request.contextPath}/roleManage/deleteById",
                    type:"POST",
                    data:{uid:uid,rid:$("#idss").val()},
                    success:function (data) {
                        console.log(data)
                        if (data.code!=null || data.code!=''){
                            window.location.reload();
                        }
                    },
                    error:function () {
                        alert("erer")
                    }
                });
                layer.msg('删除成功', {icon: 1});
            }, function(){
                layer.msg('已取消删除', {
                    time: 3000, //3s后自动关闭
                    btn: ['确定  ']
                });
            });

        }
        function add() {
            var ids = $("#idss").val()
            parent.layer.open({

                type: 2,
                title: '选择用户',
                area: ['900px', '600px'],
                shadeClose: true, //点击遮罩关闭
                content:'${request.contextPath}/roleManage/userTree?id='+ids,
                end: function () {
                    location.reload();
                }

            });
        }


</script>
</html>
